<template>
  <div class="tijian-detail">
    <div class="slider">
      <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white" v-if="info.picurl">
        <van-swipe-item v-for="(item,index) in info.picurl" :key="index">
          <img :src="item" alt="" srcset="" style="max-height: 200px">
        </van-swipe-item>
      </van-swipe>
      <img :src="`${staticPath}/img_hulidaojia@2x.png`" alt="" v-else />
    </div>
    <div class="desc">
      <div class="title">
        <van-tag type="warning" size="small" plain v-if="info.bargain" style="margin-right:5px">特价</van-tag>
        {{info.name}}
      </div>
      <p class="description">
        {{info.abstract}}
      </p>
      <div class="price-table">
        <div class="left" v-if="info.is_free == 2">
          <em>￥</em><i class="num">{{info.price}}</i> <em class="line-price">¥{{info.lineation}}</em>
        </div>
        <div class="left" v-else><em>免费</em></div>
        <div class="right">
          <em>{{info.subscribe_num || 0}}人购买</em>
        </div>
      </div>
    </div>

    <van-cell-group class="panel-cell">
      <van-cell
        title="体检机构："
        :value="info.organ_name"
        :icon="`${staticPath}/icon_muying@2x.png`"
        
      />
      <van-cell
        title="体检项目："
        :value="`${info.number}个`"
        :icon="`${staticPath}/icon_dinwei@2x.png`"
        
      />
      <van-cell
        title="体检类型："
        :value="info.type"
        :icon="`${staticPath}/icon_yuyuejilv@2x.png`"
        
      />
      <van-cell
        title="适用人群："
        :value="info.suit_people"
        :icon="`${staticPath}/icon_yuyuejilv@2x.png`"
        
      />
      <van-cell
        title="适用性别："
        :value="info.suit_sex"
        :icon="`${staticPath}/icon_yuyuejilv@2x.png`"
        
      />
    </van-cell-group>

    <div class="common-panel">
      <div class="huli-common-title">
        <h3><em></em>体检项目明细：</h3>
        <div class="common-desc" v-html="info.content">
          <!-- <table class="table table-bordered table-striped">
            <thead>
              <tr>
                <th colspan="2">
                  <h2 class="t-title">科室检查<em>(1项)</em></h2>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <th scope="row">一般检查</th>
                <td>一般检查 内科、外科、眼科、耳鼻喉科、口腔科</td>
              </tr>
            </tbody>
            <thead>
              <tr>
                <th colspan="2">
                  <h2 class="t-title">实验室检查<em>(6项)</em></h2>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <th scope="row">艾滋、梅毒</th>
                <td>
                  筛查是否感染艾滋、梅毒筛查是否感染艾滋、梅毒筛查是否感染艾滋、梅毒筛查是否感染艾滋、梅毒
                </td>
              </tr>
              <tr>
                <th scope="row">艾滋、梅毒</th>
                <td>
                  筛查是否感染艾滋、梅毒筛查是否感染艾滋、梅毒筛查是否感染艾滋、梅毒筛查是否感染艾滋、梅毒
                </td>
              </tr>
            </tbody>
          </table> -->

        </div>
      </div>
      <div class="huli-common-title">
        <h3><em></em>预约须知：</h3>
        <div class="common-desc" v-html="info.notice">
          <!-- <table class="table table-bordered table-striped">
            <tbody>
              <tr>
                <th scope="row">
                  预约时间
                </th>
                <td>该医院需在体检前1个工作日预约</td>
              </tr>
              <tr>
                <th scope="row">
                  预约时间
                </th>
                <td>该医院需在体检前1个工作日预约该医院需在体检前1个工作日预约该医院需在体检前1个工作日预约该医院需在体检前1个工作日预约</td>
              </tr>
              
            </tbody>
          </table> -->
        </div>
      </div>
      <div class="huli-common-title">
        <h3><em></em>步骤流程如下：</h3>
        <div class="common-desc" v-html="info.process">
        </div>
      </div>
      <div class="huli-common-title">
        <h3><em></em>体检注意事项：</h3>
        <div class="common-desc" v-html="info.matter">
          <!-- <table class="table table-bordered table-striped">
            <tbody>
              <tr>
                <th scope="row">
                  体检前
                </th>
                <td>
                  <div class="media">
                    <div class="media-left">
                      <img :src="`${staticPath}/icon_xuanzhe_s@2x(2).png`" alt="">
                    </div>
                    <div class="media-right">
                      <p>该医院需在体检前1个工作日预约该医院需在体检前1个工作日预约该医院需在体检前1个工作日预约该医院需在体检前1个工作日预约</p>
                    </div>
                  </div>
                </td>
              </tr>
              <tr>
                <th scope="row">
                  体检中
                </th>
                <td>
                  <div class="media">
                    <div class="media-left">
                      <img :src="`${staticPath}/icon_xuanzhe_s@2x(2).png`" alt="">
                    </div>
                    <div class="media-right">
                      <p>该医院需在体检前1个工作日预约该医院需在体检前1个工作日预约该医院需在体检前1个工作日预约该医院需在体检前1个工作日预约</p>
                    </div>
                  </div>
                </td>
              </tr>
              <tr>
                <th scope="row">
                  体检后
                </th>
                <td>
                  <div class="media">
                    <div class="media-left">
                      <img :src="`${staticPath}/icon_xuanzhe_s@2x(2).png`" alt="">
                    </div>
                    <div class="media-right">
                      <p>该医院需在体检前1个工作日预约该医院需在体检前1个工作日预约该医院需在体检前1个工作日预约该医院需在体检前1个工作日预约</p>
                    </div>
                  </div>
                </td>
              </tr>
              
            </tbody>
          </table> -->
        </div>
      </div>
      <div class="huli-common-title">
        <h3><em></em>体检报告解读</h3>
        <div class="common-desc">
          <div class="notips" v-html="info.interpret">
            <!-- <p class="center-text">请扫码关注微信：***********</p>
            <p>1.全科医疗团队为您解读体检报告，分析解答报告疑问；</p>
            <p>1.全科医疗团队为您解读体检报告，分析解答报告疑问；</p>
            <p>1.全科医疗团队为您解读体检报告，分析解答报告疑问；</p>
            <img src="http://placeholder.idcd.com/?w=90&h=90&bgcolor=%236c757d&fontcolor=%23d3d3d3&fontsize=20&fontfamily=1" alt="">
            <p>微信扫一扫添加医生好友</p> -->
          </div>
        </div>
      </div>
    </div>

    <van-goods-action>
      <van-goods-action-icon icon="chat-o" text="客服" @click="onClickIcon" />
      <van-goods-action-button
        :color="'linear-gradient(0deg, #FF534F 0%, #FF9C78 100%)'"
        text="立即预约"
        @click="onClickButton"
      />
    </van-goods-action>
  </div>
</template>

<script>
import { checksInfoServer } from '@/service/server'
export default {
  data() {
    return {
      staticPath: process.env.VUE_APP_STATIC_PATH,
      value: 3,
      info: {}
    };
  },

  created(){
    this.queryInfo(this.$route.params.id)
  },

  components: {},

  computed: {},

  methods: {
    async queryInfo(id){
      let result = await checksInfoServer(id);
      if(result.status == 200){
        this.info = result.data
      }
    },
    onClickIcon() {},
    onClickButton() {
      this.$router.push({
        path: '/user/medical/order/index',
        query: {
          check_id: this.info.id,
          check_name: this.info.name
        }
      })
    },
  },
};
</script>
<style lang='less'>
.tijian-detail {
  background: #f5f5f5f5;
  padding-bottom: 50px;
  .notips{
    text-align: center;

    img{
      width: 90px;
    }
  }
  .btn-center {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    .van-button {
      padding-left: 20px;

      padding-right: 20px;
    }
  }
  .custom-cell {
    padding-left: 0;
    padding-right: 0;
    background: #fff;
    .custom-title {
      font-size: 16px;
    }
    .van-cell__title {
      padding-left: 10px;
    }
  }
  .table{
    thead{
      text-align: left;
      padding: 10px;
    }
    .t-title{
      font-size: 16px;
      color: #000;
      padding: 15px 0;
      em{
        color: #4ECE40;
      }
    }
    tbody{
      tr{
        th{
          width: 95px;
          padding: 10px;
        }
        td{
          padding: 10px;
        }
      }
    }
    .media{
      display: flex;
      justify-content: flex-start;
      align-items: flex-start;
      .media-left{
        width: 12px;
        height: 12px;
        margin-right: 4px;
        vertical-align: middle;
        img{
          width: 100%;
        }
      }
      .media-right{
        flex: 1;
        vertical-align: middle;
      }
    }
  }
  .create-time {
    padding: 8px 0;
    color: #999;
    font-size: 13px;
  }
  .panel-cell {
    margin-top: 10px;
    background: #fff;
    .van-cell{
      background: transparent
      ;
    }
  }
  .comment-grid {
    .van-grid-item__content {
      padding: 0;
    }
  }
  .common-panel {
    margin-top: 10px;
    background: #fff;
    padding: 15px;
  }
  .slider {
    width: 100%;
    height: 220px;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .desc {
    padding: 0 15px;
    background: #fff;
    .title {
      display: flex;
      justify-content: flex-start;
      align-items: center;
      font-size: 18px;
      font-weight: bold;
      color: #000;
      padding: 10px 0;
    }
    .description {
      line-height: 1.5;
      color: #999;
    }
  }
  .price-table {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 0 20px 0;
    margin-top: 15px;
    .right {
      color: #999;
      font-size: 14px;
    }
    .left {
      flex: 1;
      font-size: 13px;
      color: #E02E2E;
      .num{
        font-size: 18px;
      }
      .line-price {
        color: #999;
        font-size: 12px;
        margin-left: 10px;
      }
    }
  }
  .common-desc {
    p {
      color: #999;
      // line-height: 1.5;
    }
  }
  .comment-pre {
    color: #999;
    line-height: 1.5;
    font-size: 13px;
  }
  .huli-common-title {
    margin-bottom: 15px;
    .right-arrow {
      display: flex;
      justify-content: flex-end;
      color: #999;
      font-size: 13px;
      flex: 1;
    }
    h3 {
      font-size: 16px;
      margin-bottom: 15px;
      display: flex;
      justify-content: flex-start;
      align-items: center;
      em {
        display: inline-block;
        width: 5px;
        height: 17px;
        background: linear-gradient(0deg, #fcc9cb, #f7757b);
        border-radius: 5px;
        margin-right: 6px;
      }
    }
  }
}
</style>